package com.globalwave.base;

import java.util.HashSet;
import java.util.Set;

public class BaseEntity implements Cloneable{
    private Set<String> exclusions ;
    private Set<String> inclusions ;

    public static final short OPERATE_INSERT = 1 ;
    public static final short OPERATE_UPDATE = 2 ;
    public static final short OPERATE_DELETE = 3 ;
    
    private boolean isUpdate = true ;
    private short operate = 0;
    
    public void addExclusions(String property) {
    	
    	if (isUpdate == false) {
    		return ;
    	}
    	
        if (exclusions == null) {
            exclusions = new HashSet<String>() ;
        }
        
        exclusions.add(property) ;
    }

    public Set<String> getExclusions() {
        return exclusions;
    }

    public void addInclusions(String property) {

    	if (isUpdate == false) {
    		return ;
    	}
    	
        if (inclusions == null) {
        	inclusions = new HashSet<String>() ;
        }
        
        inclusions.add(property) ;
    }

    public Set<String> getInclusions() {
        return inclusions;
    }

	public short getOperate() { 
		return operate;
	}

	public void setOperate(short operate) {
		this.isUpdate = (operate == OPERATE_UPDATE) ;
		this.operate = operate;
	}

}
